package com.trust.entity.VO;

import com.trust.agri.sign.validate.SaveValidate;
import com.trust.agri.sign.validate.UpdateValidate;
import com.trust.entity.MedicineStandard;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Null;
import java.util.List;

/**
 * @author ccc
 * @desc
 * @since 2023/11/14 18:41
 */
@Data
@ApiModel("药材vo")
public class MedicineVO {

    @ApiModelProperty("id")
    @Null(message = "id 只能为空", groups = {SaveValidate.class})
    @NotNull(message = "id 不能为空", groups = {UpdateValidate.class})
    private Integer id;

    @ApiModelProperty("是否启用")
    @NotNull(message = "是否启用 不能为空", groups = {SaveValidate.class, UpdateValidate.class})
    private Integer enabled;

    @ApiModelProperty("是否默认")
    @NotNull(message = "是否默认 不能为空", groups = {SaveValidate.class, UpdateValidate.class})
    private Integer isDefault;

    @ApiModelProperty(value = "药材等级", allowEmptyValue = true)
    private Integer grade;

    @ApiModelProperty(value = "药材等级名称")
    private String gradeName;

    @ApiModelProperty(value = "药材介绍", allowEmptyValue = true)
    private String introduce;

    @ApiModelProperty("药材名称")
    @NotBlank(message = "药材名称 不能为空", groups = {SaveValidate.class, UpdateValidate.class})
    private String name;

    @ApiModelProperty(value = "药材编号")
    //@NotBlank(message = "药材编号 不能为空", groups = {SaveValidate.class, UpdateValidate.class})
    private String code;

    @ApiModelProperty(value = "药材图片", allowEmptyValue = true)
    private String pic;

    @ApiModelProperty(value = "种苗单位", allowEmptyValue = true)
    private Integer seedUnit;

    @ApiModelProperty(value = "种苗单位名称")
    @NotBlank(message = "种苗单位 不能为空", groups = {SaveValidate.class, UpdateValidate.class})
    private String seedUnitName;

    @ApiModelProperty("销售规格")
    @NotEmpty(message = "销售规格 不能为空", groups = {SaveValidate.class, UpdateValidate.class})
    private List<MedicineStandard> standardList;
}
